//  Titlepic generation equipment (random images at top of lessons)

function getTitlePic(tutorial,lesson)
{
   thisPic = getRandom(23); // Number of pics available. Make sure the number here matches the quantity available below! There's no error checking. 
   //thisPic = 23; //testing                                      WIDTH  HEIGHT
        if (thisPic == 1)  { titlepicInfo = new Array("01", "l", "150", "292"); }
   else if (thisPic == 2)  { titlepicInfo = new Array("02", "r", "201", "155"); }
   else if (thisPic == 3)  { titlepicInfo = new Array("03", "l", "187", "246"); }
   else if (thisPic == 4)  { titlepicInfo = new Array("04", "r", "230", "212"); }
   else if (thisPic == 5)  { titlepicInfo = new Array("05", "l", "228", "193"); }
   else if (thisPic == 6)  { titlepicInfo = new Array("06", "r", "273", "181"); }
   else if (thisPic == 7)  { titlepicInfo = new Array("07", "l", "195", "211"); }
   else if (thisPic == 8)  { titlepicInfo = new Array("08", "r", "215", "219"); }
   else if (thisPic == 9)  { titlepicInfo = new Array("09", "r", "172", "266"); }
   else if (thisPic == 10) { titlepicInfo = new Array("10", "r", "174", "216"); }
   else if (thisPic == 11) { titlepicInfo = new Array("11", "l", "198", "196"); }
   else if (thisPic == 12) { titlepicInfo = new Array("12", "r", "202", "214"); }
   else if (thisPic == 13) { titlepicInfo = new Array("13", "r", "210", "144"); }
   else if (thisPic == 14) { titlepicInfo = new Array("14", "l", "178", "222"); }
   else if (thisPic == 15) { titlepicInfo = new Array("15", "l", "194", "226"); }
   else if (thisPic == 16) { titlepicInfo = new Array("16", "l", "274", "194"); }
   else if (thisPic == 17) { titlepicInfo = new Array("17", "l", "212", "200"); }
   else if (thisPic == 18) { titlepicInfo = new Array("18", "r", "230", "178"); }
   else if (thisPic == 19) { titlepicInfo = new Array("19", "r", "233", "259"); }
   else if (thisPic == 20) { titlepicInfo = new Array("20", "r", "180", "244"); }
   else if (thisPic == 21) { titlepicInfo = new Array("21", "l", "122", "207"); }
   else if (thisPic == 22) { titlepicInfo = new Array("22", "r", "202", "231"); }
   else if (thisPic == 23) { titlepicInfo = new Array("23", "l", "162", "223"); }

   // Lesson 1 is always the pointing teacher
   if(lesson == "Lesson 1") { titlepicInfo = new Array("00", "l",  "277", "229"); }

   // Lesson 24 of SYWTMAWP is always the signpost
   if((tutorial == "So, you want to make a Web Page!")&&(lesson == "Lesson 24")) { titlepicInfo = new Array("05", "l", "228", "193"); }


   titlepicName   = titlepicInfo[0];
   titlepicSide   = titlepicInfo[1];
   titlepicWidth  = titlepicInfo[2];
   titlepicHeight = titlepicInfo[3];

   if(tutorial == "So, you want to make a Web Page!")
   { textSizeLine1 = "18px"; textSizeLine2 = "32px"; } else
   { textSizeLine1 = "32px"; textSizeLine2 = "18px"; }

   tpline = "";

   if (titlepicSide == "l")
   {
      tpline += "<table style='clear:both;font-family:arial,sans-serif;margin-left:auto;margin-right:auto;'><tr>";
      tpline += "<td><img src='../common/titlepic" + titlepicName + ".gif' height='" + titlepicHeight + "' width='" + titlepicWidth + "' alt=''></td>";
      tpline += "<td style='text-align:left;padding-left:20px;'><span style='font-size:" + textSizeLine1 + "'>" + tutorial + "</span><br><span style='font-size:" + textSizeLine2 + ";padding-left:10px;'>" + lesson + "</span></td>";
      tpline += "</tr></table>";
   }
   else // we assume it's right
   {
      tpline += "<table style='clear:both;font-family:arial,sans-serif;margin-left:auto;margin-right:auto;'><tr>";
      tpline += "<td style='text-align:left;padding-right:20px;'><span style='font-size:" + textSizeLine1 + "'>" + tutorial + "</span><br><span style='font-size:" + textSizeLine2 + ";padding-left:10px;'>" + lesson + "</span></td>";
      tpline += "<td><img src='../common/titlepic" + titlepicName + ".gif' height='" + titlepicHeight + "' width='" + titlepicWidth + "' alt=''></td>";
      tpline += "</tr></table>";
   }

   tpline += "<hr class='hvydivide'>";

   return tpline;
}
